cmake_minimum_required(VERSION 3.10)
project(rtsp_to_rtmp)

# 查找依赖包
find_package(PkgConfig REQUIRED)

pkg_check_modules(GST REQUIRED 
    gstreamer-1.0
    gstreamer-app-1.0
    gstreamer-base-1.0
    gstreamer-rtsp-server-1.0
    glib-2.0 
    gobject-2.0
)

# 设置包含目录
include_directories(
    ${GST_INCLUDE_DIRS}
)

# 设置链接库
link_directories(
    ${GSTREAMER_LIBRARY_DIRS}
    ${GSTREAMER_APP_LIBRARY_DIRS}
    ${GLIB_LIBRARY_DIRS}
)

# 添加可执行文件
add_executable(rtsp_to_rtmp
    src/image2rtmp.cpp
)

# 链接库
target_link_libraries(rtsp_to_rtmp
    ${GLIB_LIBRARIES}
    ${GSTREAMER_LIBRARIES}
    -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
)